package com.cresch.ical.downloader;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

public class EventDetail extends Activity {
	
	// UI Elements
	private TextView dateTime;
	private TextView location;
	private TextView description;
	private Button close;
	
	// defines for inter-activity data transfer
	public static final String DATETIME = "DATETIME";
	public static final String LOCATION = "LOCATION";
	public static final String DESCRIPTION = "DESCRIPTION";
	
	/** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
    	super.onCreate(savedInstanceState);
        setContentView(R.layout.event_detail);
        
        // bind class attributes to UI elements
        dateTime = (TextView) findViewById(R.id.DateTime);
        location = (TextView) findViewById(R.id.Location);
        description = (TextView) findViewById(R.id.Description);
        close = (Button) findViewById(R.id.Close);
        
        // display detail data
        Bundle data = this.getIntent().getExtras();
        dateTime.setText(data.getString(DATETIME));
        location.setText(data.getString(LOCATION));
        description.setText(data.getString(DESCRIPTION));
        
        close.setOnClickListener(new OnClickListener(){
        	public void onClick(final View v) {
        		finish();
        	}
        });
                
    }    
}
